import { ObjectType, Field } from '@nestjs/graphql';
import { Product } from 'src/products/entities/product.entity';
import { Column, Entity, OneToMany, PrimaryColumn } from 'typeorm';

@ObjectType()
@Entity()
export class Owner {
  @Field()
  @PrimaryColumn()
  id?: number;
  @Field()
  @Column()
  name: string;
  @Field()
  @Column()
  email: string;
  @Field()
  @Column()
  gender: string;

  @Field(() => [Product])
  products: Product[];
}
